package cn.com.gzheroli.rabbitmq.service.consumer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageListener;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import cn.com.gzheroli.rabbitmq.service.producer.MessageProducerService;

/**
 * Created by lhx on 2016/9/5 9:57
 *
 * @Description 消费接收
 */
public class MessageConsumer{

    private Logger logger = LoggerFactory.getLogger(MessageConsumer.class);


    public static void main(final String... args) throws Exception {
        AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("RabbitMQ.xml");
        MessageProducerService messageProducer = (MessageProducerService) ctx.getBean("messageProducerService");
        //messageProducer.sendMessage("-------------hello,xin3453465465467456456456^^^^^^66666!");
        Thread.sleep(1000);
        ctx.destroy();
    }

}
